using System;

namespace QDCommon.Time{
    public class TimeStampHelper{

        public static long TimeStamp()
        {
            TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);  
            return Convert.ToInt64(ts.TotalMilliseconds);
        }
        public static DateTime ConvertStempToTime(long timestemp)
        {
            var ts = TimeSpan.FromMilliseconds(timestemp);
            return new DateTime(1970, 1, 1, 0, 0, 0, 0) + ts;
        }


        public static long UtcTimeStamp()
        {
            TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
            return Convert.ToInt64(ts.TotalMilliseconds);
        }
       
    }

}